<template>
	<view class="content">
		<u-image width="100%" :mode="'aspectFill'" height="550rpx" :src="src"></u-image>
		<view class="card_am">
			<view class="P_title b_b">
				视频推荐 视频类目 》文娱-其他视频
			</view>
			<view class="card" v-for="(item,index) in list" :key="index" @click="toVedio(item)">
				<view style="width: 9em;">
					<image src="https://xdsbz.com:802/prod-api/profile/upload/my/shipin.png"
						style="width: 100%;" mode="widthFix"></image>
					<!-- <video :src="getVideoUrl(item)" :controls="false" style="width: 120rpx;height: 120rpx"></video> -->
				</view>
				<view class="" style="margin-left: 20rpx;width: 100%;">
					<view class="card_title">
						{{item.viTitle}}
					</view>
					<view class="card_text">
						<div>
							该视频来源于【腾讯视频网站】
							<!-- 观看次数{{item.viNum}}-->
						</div>
						<div>文娱-其他视频</div>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		url
	} from '@/common/index.js'
	import {
		getVideo,
		getBg
	} from "@/common/api.js"
	export default {
		name: "school",
		data() {
			return {
				src: "",
				list: [],
				controls: false
			};
		},
		created() {
			this.getVideo()
			this.getBg()
		},
		methods: {
			toVedio(){
				uni.navigateTo({
					url:'/pages/shipin?url=https://v.qq.com/x/page/b3566d2rxgw.html'
				})
			},
			// 获取视频
			async getVideo() {
				let data = await getVideo(1)
				this.list = data.rows
			},
			// 查询背景图
			async getBg() {
				let data = await getBg(120)
				this.src = url + data.rows[0].baUrl
			},
			// 返回视频地址
			getVideoUrl(item) {
				return url + item.viUrl
			},
			play(item) {
				uni.setStorageSync("videoInfo", item)
				uni.navigateTo({
					url: "/pagesSchool/school/playVideo"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.clear {
		clear: both;
	}

	.content {
		background-color: #222 !important;
		min-height: 96vh;
	}

	.P_title {
		margin-top: 30rpx;
		padding-left: 30rpx;
		font-size: 32rpx;
		font-weight: 600;
		color: #C49266;
	}

	.b_b {
		border-left: 10rpx solid #C49266;
	}

	.card {
		margin: 20rpx 0;
		padding: 15rpx 15rpx;
		border-radius: 15rpx;
		display: flex;
		background-color: rgba(68, 68, 68, 0.4);
	}

	.card_title {
		font-size: 32rpx;
		color: #C49266;
	}

	.card_text {
		padding: 20rpx 0;
		font-size: 26rpx;
		color: #C49266;
	}

	.card_am {
		padding: 0 30rpx 30rpx;
		width: 100%;
		animation: moveRight 2s;
		/* 动画名称，持续时间，迭代次数 */
	}

	/* 定义动画 */
	@keyframes moveRight {
		from {
			transform: translateY(-200rpx);
		}

		to {
			transform: translateY(0);
			/* 从当前位置平移100像素 */
		}
	}

	/deep/ video .uni-video-cover {
		display: none !important;
	}

	video::-webkit-media-controls-play-button {
		display: none;
	}

	/* 针对Firefox */
	video::-moz-media-controls-play-button {
		display: none;
	}

	/* 针对IE和Edge */
	video::-ms-media-controls-play-button {
		display: none;
	}

	/* 针对Opera */
	video::-o-media-controls-play-button {
		display: none;
	}
</style>